
var selectObj; 

$(document).bind("mobileinit", function(){
	//はじめに読んでおかないと失敗する？？
	initSelectObject();
});

function initSelectObject(){
	selectObj = $('select.navi-select');
	selectObj.selectmenu({
		corners:"true",
		iconpos:"bottom",
		nativeMenu:"false",
		theme:"a"
	});
	selectObj.change(changeEvent);
}

function changeEvent() {
	var selected = null;
	$(this).children().each(function() {
		if($(this).attr('selected') != undefined) {
			selected = $(this).val();
		}
	});
	selectObj.each(function() {
		$(this).val(selected);
		selectObj.selectmenu('refresh');
		//これしないと全部適応されない
	});
	$.mobile.changePage('#' + selected);
}

